{% extends "base.html" %}
{% load i18n %}
{% load markup %}

{% block title %}{% trans "Projects" %}{% endblock %}

{% block page-title %}
  {% trans "Browse projects" %}
{% endblock %}

{% block navigation %}
  {% activetab "main" "projects" %}
  {{ block.super }}
{% endblock %}

{% block sub-navigation %}
  <form method="post" action="{% url inhouse.views.request_projectuser%}">
  {% csrf_token %}
    {{ form.project.label }}: {{ form.project }}
    <input type="submit" value="{% trans "Request membership" %}">
  </form>
{% endblock %}

{% block content %}

  <h3>
    <a id="active_projects-pointer" href="javascript:inhouse.toggle_section('active_projects');" class="toggled-section">{% trans "Active projects" %}</a>
  </h3>
  <div id="active_projects" class="default-list">
    <div class="pagination">
    </div>
    <table id="project-list" class="default-table">
      <thead>
        {% include "project_heading.html" %}
      </thead>
      <tbody>
        {% for project in active_projects.object_list %}
          {% include "project_row.html" %}
        {% empty %}
          <tr><td class="first last" colspan="11">{% trans "No entries found" %}</td></tr>
        {% endfor %}
      </tbody>
    </table>
    <div class="pagination">
      {% include "pagination.html" with objects=active_projects %}
    </div>
  </div>

  <h3>
    <a id="inactive_projects-pointer" href="javascript:inhouse.toggle_section('inactive_projects');" class="toggled-section">{% trans "Inactive projects" %}</a>
  </h3>
  <div id="inactive_projects" class="default-list">
    <div class="pagination">
    </div>
    <table id="project-list" class="default-table">
      <thead>
        {% include "project_heading.html" %}
      </thead>
      <tbody>
        {% for project in inactive_projects.object_list %}
          {% include "project_row.html" %}
        {% empty %}
          <tr><td class="first last" colspan="11">{% trans "No entries found" %}</td></tr>
        {% endfor %}
      </tbody>
    </table>
    <div class="pagination">
      {% include "pagination.html" with objects=inactive_projects %}
    </div>
  </div>

<!--
  {% for project, results, members in projects %}
  <div class="entry">
    <div class="card card-common">
      <div class="card-content">
        <div class="entry-content">
        <div class="entry-main">
          <div class="entry-date">
            {{ project.status }}
          </div>
          <h3 class="entry-title" style="color:#333;">{{ project.name }}</h3>
          <div class="entry-body">
            <p>{{ project.get_description }}</p><br/>
            <p>
              <a id="project-{{ project.id }}-pointer" href="javascript:inhouse.toggle_section('project-{{ project.id }}');" class="toggled-section ">
              <span id="project-{{ project.id }}-image" class="sprite plus"></span></a><strong>{% trans "Project members" %}</strong>
              <div id="project-{{ project.id }}" style="display:none; margin-top: 10px;">
              {% for user in members %}
                {{ user.id|show_user_link }}
              {% endfor %}
              </div>
            </p>
          </div>
        </div>
        </div>
        <div class="entry-icons">
          {% include "booking_star.html" %}
        </div>
        <div class="card-bottom">
          <strong>{% trans "Customer" %}:</strong> {{ project.customer }} <strong>{% trans "Type" %}:</strong> {{ project.type }}
        </div>
      </div>
    </div>
  </div>

  {% endfor %}
  -->
{% endblock %}
